package com.youyun56;

import java.io.FileInputStream;

import javax.sql.DataSource;

import org.apache.commons.dbcp.BasicDataSourceFactory;

import com.j3.db.ConnectionManager;
import com.youyun56.commons.PathConfig;
import com.youyun56.gps.schedual.GPS;
import com.youyun56.gps.schedual.GPSFactory;

public class GPSMain {
    public static void main(String[] args) throws Exception {
        PropertyManager.getInstance().load(new FileInputStream(PathConfig.GPS_FILE_NAME));

        DataSource bds = BasicDataSourceFactory.createDataSource(PropertyManager.getInstance());
        ConnectionManager.registerDataSource("gps", bds);
        ConnectionManager.setDefaultDataSourceName("gps");
        GPSFactory.init(PathConfig.GPS_FILE_NAME);
//        GPSFactory.testSQL();
        new Thread(new GPS()).start();

    }
}
